/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PropertyRental.war.servlets;

import PropertyRental.ejb.beans.AbstractFacade;
import PropertyRental.ejb.beans.AccountFacade;
import PropertyRental.ejb.beans.AgentFacade;
import PropertyRental.ejb.beans.CustomerFacade;
import PropertyRental.ejb.beans.LoginEJB;
import PropertyRental.ejb.beans.OwnerFacade;
import PropertyRental.ejb.beans.PropertyFacade;
import PropertyRental.ejb.beans.PropertyRentFacade;
import PropertyRental.ejb.beans.UsersFacade;
import PropertyRental.ejb.beans.VisitingPropertyFacade;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author Sébastien
 */
public abstract class Action {

    private final String successpage;
    private final String failpage;
    protected AbstractFacade abstractEJB;
    protected AccountFacade accountEJB;
    protected AgentFacade agentEJB;
    protected CustomerFacade customerEJB;
    protected LoginEJB loginEJB;
    protected OwnerFacade ownerEJB;
    protected PropertyFacade propertyEJB;
    protected PropertyRentFacade propertyrentEJB;
    protected UsersFacade usersEJB;
    protected VisitingPropertyFacade visitingpropertyEJB;


    public Action(String success, String fail) {
        this.successpage = success;
        this.failpage = fail;
    }
    public abstract String perform(HttpServletRequest req);

    /**
     * @return the successpage
     */
    public String getSuccesspage() {
        return successpage;
    }

    /**
     * @return the failpage
     */
    public String getFailpage() {
        return failpage;
    }

    public void setAbstractEJB(AbstractFacade abstractEJB) {
        this.abstractEJB = abstractEJB;
    }

    public void setAccountEJB(AccountFacade accountEJB) {
        this.accountEJB = accountEJB;
    }

    public void setAgentEJB(AgentFacade agentEJB) {
        this.agentEJB = agentEJB;
    }

    public void setCustomerEJB(CustomerFacade customerEJB) {
        this.customerEJB = customerEJB;
    }

    public void setLoginEJB(LoginEJB loginEJB) {
        this.loginEJB = loginEJB;
    }

    public void setOwnerEJB(OwnerFacade ownerEJB) {
        this.ownerEJB = ownerEJB;
    }

    public void setPropertyEJB(PropertyFacade propertyEJB) {
        this.propertyEJB = propertyEJB;
    }

    public void setPropertyRentEJB(PropertyRentFacade propertyrentEJB) {
        this.propertyrentEJB = propertyrentEJB;
    }

    public void setUsersEJB(UsersFacade usersEJB) {
        this.usersEJB = usersEJB;
    }

    public void setVisitingPropertyEJB(VisitingPropertyFacade visitingpropertyEJB) {
        this.visitingpropertyEJB = visitingpropertyEJB;
    }
}
